package com.geek;

import dagger.Component;
import dagger.Module;
import dagger.Provides;

import javax.inject.Inject;
import javax.inject.Singleton;

public class SimpleApplication {
    static final class Foo {
        @Inject
        Foo() {
            System.out.println("Foo Foo");
        }

        void print() {
            System.out.println("lalalalalal");
        }
    }

    @Module
    static final class SimpleModule {
        @Provides
        Foo provideFoo() {
            return new Foo();
        }
    }

    @Singleton
    @Component(modules = SimpleModule.class)
    interface SimpleComponent {
        Foo foo();
    }

    public static void main(String[] args) {
        Foo foo = DaggerSimpleApplication_SimpleComponent.create().foo();
        foo.print();
    }
}
